The Caveman Sound System is a high-level library of C routines for playing sound on the Macintosh. These routines were designed with games in mind, but could be used for other purposes as well. They have been included in my own products such as PowerPong , and I indend to use them in future projects.
What's New?
A few new routines have been added since the initial release as follows:
CMSGetChannelVolume – Returns the volume on a sound channel.
CMSSetChannelVolume – Changes the volume on a sound channel.
CMSOpenSoundTool – This is a new method for initializing the sound system. It performs the functions CMSInitSound and CMSOpenAllChannels. This is now the preferred method for initializing the sound system.
CMSPlaySoundPriority – Plays a sound with a given priority on any sound channel.
CMSSetToolVolume – Increment the volume on all sound channels.
In addition, the following enhancements have been made:
• Better support for PPC machines.
• Added double buffer support for faster sound playback on machines that support it.
• Added stereo sound support in channel allocation for Macs that support it.
• Compiled libraries are now part of the distribution.
How Do I Use The Caveman Sound System?
To use The Caveman Sound System, simply add the appropriate library (one of the "Caveman Sound *.lib" files) in your project and include "CMSoundSystem.h" in the file calling the sound system. If an appropriate library file does not exist for your compiler and architecture, include the file "CMSoundSystem.c" instead. Documentation for using the sound system is provided in the "CMSoundSystem.h" header file. I have tried to make the documentation as complete as possible, but either the source code or myself may be consulted if a question should arise.
What is Included With The Sound System?
There should be five files included with The Caveman Sound System. The following is a list of each file and its purpose:
Caveman Sound Readme - This file.
Caveman Sound 68K.µ
Caveman Sound 68K.π - Projects for building the library for 68K machines using the different compilers available.
Caveman Sound PPC.µ - Projects for building the library for PowerPC machines using the different compilers available.
CMSoundSystem.c - This is the source for the sound system. You should include this in the project of any program that uses the sound system routines.
CMSoundSystem.h - This is the interface to the sound system. This is also where each of the routines is documented in detail.
Libs - A folders containing compiled libraries for various compilers. This includes 68K as well as PPC versions. Their names are in the form "Caveman Sound ARCH.COMPILER.lib" where ARCH is either 68K or PPC and COMPILER is either CW, MPW, or THINK. (Thanks to Dario Accornero for the Code Warrior versions of the libraries)
Reference Manual (CW)
Reference Manual (RTF) - A reference manual for the library in ClarisWorks (CW) and Rich Text Format (RTF).
sndtest.c - This is the source for a example program and tutorial. It provides an example of how the sound system is typically used. I have included copious documentation in this file as well to serve as a tutorial of sorts.
sndtest.π - The project file for the example program. This is a THINK C 5.0 project. Sorry, Code Warrior users, you'll have to build your own project.
sndtest.π.rsrc - Resources for the example program. It includes a few sound resources used by the example program as well as a template resource ('TMPL') for creating 'MUSL' resources used by the music loader. The music, by the way, is a segment of the music from PowerPong and was written by Michael Hay.
Permission to use, copy, and distribute this software and its documentation for any purpose is hereby granted without fee, provided that (i) the above copyright notices and this permission notice appear in all copies of the software and related documentation, and (ii) the names of David Hay and Caveman Creations may not be used in any advertising or publicity relating to the software without the specific, prior written permission of David Hay.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL DAVID HAY OR CAVEMAN CREATIONS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Lawyer mode off.
Ok. Basically what the above says is that you can do anything you want with the library except the following:
1. You can't sell it.
2. You can't claim it for your own.
3. Any redistribution must include the above copyright notice and this file.
4. If it kills your pet ferret, I'm not responsible.
While the library is free, I would appriciate some form of compensation if you do use the program in your own projects. I would accept either money ($10-$20 US would be about right) or a fully registered version of any programs the library is used in. Again this is not a requirement, but rather a request.
Release Notes
1.1.1 – 06/21/97
• Fixed a memory leak caused by CMSRegisterSound and some related bugs.
• Switched to CodeWarrior IDE 2.0 projects
1.1 – 03/05/96
• Incorporated the following changes made by Dario Accornero (dappsoft@mix.it) Thanks Dario for all your work!
– added PPC support in the callback routine
– added stero Macs support in the channel allocation routines
– added double buffer support in order to speed up sound output on all Macs
– chaned SoundSystem allocation, in order to lower global vars space memory charge; now, the SoundSystem is accessed thru a pointer, so it is *necessary* to allocate the system before using it, otherwise the code will crash…
– added priorities support
– added channel volume control (get/set)
• Cleaned up the code a bit.
• Added some internal routines for code that was getting repeated by both sound and music routines.
• Added compiled libraries to the distribution.
• The distribution now includes a more formal reference manual
1.0 – 09/11/95
• Initial Release
Still To Do…
I have tried to make the library as complete and easy to use as possible. However, there are still some things I would like to add:
• Support for compressed sounds. Currently, sounds with a compressed sound header are not supported. This is not such a big deal since most games need uncompressed sounds to get decent performance anyway.
• Support for Quicktime™ music tracks. The current music system is based on sound samples, which can be very memory intensive. I would like to provide an interface to the Quicktime Music Architecture to allow more compact pieces of music.
About Caveman Creations
Caveman Creations (CMC) is a company devoted to providing quality software and development utilities for low prices. You might be wondering where the web page went. The Caveman Creations web page is currently without a home due to an expired account. If it ever comes back online, I'll probably make an appropriate posting on one of the mac programming newsgroups.
Any bug reports, comments, or questions may be directed to me at the following locations:
Electronic Mail (preferred)
dhay@cheerful.com
Postal Mail
David Hay
3228 Lake Park Way #201
Longmont, CO 80503
Macintosh, Quicktime, and Quicktime Music Architecture are trademarks of Apple Computer, Inc. THINK C is a trademark of Symantec Corporation. Codewarrior is a trademark of Metrowerks, Inc.